"""
题目一：数字water表示一排瓶子的水位高度，往瓶子里倒数一次增加1，要得到cnt个水位高度一致的瓶子，求最少需要浇水多少次？
"""
water=[7,1,9,10,2] #1,9,10,
def sortwater():  #冒泡排序
    water=[7,1,9,10,2]
    for i in range(len(water)):
        for j in range(i+1,len(water)):
            if water[i]<water[j]:
                water[i],water[j]=water[j],water[i]
    return water[0:3]

def getcount(l):
    sum=0
    for i in l[1:]:
        sum+=l[0]-i
    return sum

mi_water=sortwater()
print(getcount(mi_water))
def sortwater2():  #冒泡排序
    water=[7,1,9,10,2]
    for i in range(len(water)-1):
        for j in range(len(water)-i-1):
            if water[j]<water[j+1]:
                water[j],water[j+1]=water[j+1],water[j]
    return water

print(sortwater2())

ll=[23,1,4,56,10,2]
ll.sort()
print(ll)